//package com.jcj.jcjrpc.core.config;
//
//import com.ctrip.framework.apollo.model.ConfigChange;
//import com.ctrip.framework.apollo.model.ConfigChangeEvent;
//import com.ctrip.framework.apollo.spring.annotation.ApolloConfigChangeListener;
//import lombok.Data;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.cloud.context.environment.EnvironmentChangeEvent;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.ApplicationContextAware;
//
//@Data
//@Slf4j
//public class ApolloChangedListener  implements ApplicationContextAware {
//    ApplicationContext applicationContext;
//
//    @ApolloConfigChangeListener({"app1","application"})
//    private void changeHandler(ConfigChangeEvent changeEvent){
//        for(String key : changeEvent.changedKeys()){
//            ConfigChange change = changeEvent.getChange(key);
//            log.info("found change - {}",change.toString());
//        }
//
//        this.applicationContext.publishEvent(new EnvironmentChangeEvent(changeEvent.changedKeys()));
//    }
//}
